﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Frame
{
    public class Debug
    {
        public static void Log(string info)
        {
            Console.WriteLine(AddDateTime(info));
        }
        public static void Log(int info)
        {
            Console.WriteLine(AddDateTime(info.ToString()));
        }
        public static void Log(double info)
        {
            Console.WriteLine(AddDateTime(info.ToString()));
        }

        public static void Log(byte[] b)
        {
            string s = "";
            for (int i = 0; i < b.Length; i++)
            {
                s += b[i].ToString("X2");
                if (i < b.Length - 1)
                    s += ",";
            }
            Console.WriteLine(AddDateTime(s));
        }

        private static string AddDateTime(string info)
        {
            return "[" + DateTime.Now.ToString() + "]:" + info;
        }

        public static void Log(List<int> info_list)
        {
            string str = "[";
            int index = 0;
            foreach (int info in info_list)
            {
                str += info.ToString();
                if (index < info_list.Count - 1)
                    str += ",";
            }
            str += "]";
            Console.WriteLine(str);
        }


        public static void Log(List<double> info_list)
        {
            string str = "[";
            int index = 0;
            foreach (int info in info_list)
            {
                str += info.ToString();
                if (index < info_list.Count - 1)
                    str += ",";
                index++;
            }
            str += "]";
            Console.WriteLine(str);
        }
    }
}
